<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3c.org/1999/xhtml"
	xmlns:f="http://java.sun.com/jsf/core"
	xmlns:h="http://java.sun.com/jsf/html"
	xmlns:ui="http://java.sun.com/jsf/facelets"
	xmlns:p="http://primefaces.org/ui">
<h:body>
	<ui:composition template="template.xhtml">
		<ui:define name="content">
			<script src="http://maps.google.com/maps/api/js?sensor=false"
				type="text/javascript" />
			<script type="text/javascript"
				src="../resources/javascript/mapCodeSovtivityPoint.js" />
			<f:view>

				<h1 style="margin-bottom: 5px;">
					<h:outputText value="Damage Estimation" />
				</h1>
				<dl>
					<dt>Ticket:</dt>
					<dd>
						<h:outputText value="#{surveyorProcessController.ticket.id}" />
						<br />
					</dd>
					<dt>Customer:</dt>
					<dd>
						<h:outputText
							value="#{surveyorProcessController.ticket.customer.firstName}" />
						&nbsp;
						<h:outputText
							value="#{surveyorProcessController.ticket.customer.lastName}" />
					</dd>
					<dt>Incidents:</dt>
					<dd>
						<h:outputText
							value="#{surveyorProcessController.ticket.predictionFault}" />
					</dd>
					<dt>Address:</dt>
					<dd>
						<h:outputText
							value="#{surveyorProcessController.ticket.customer.address.street}" />
						,
						<h:outputText
							value="#{surveyorProcessController.ticket.customer.address.zip}" />
						&nbsp;
						<h:outputText
							value="#{surveyorProcessController.ticket.customer.address.city}" />
					</dd>
				</dl>
				<div style="margin-top: 20px;">
					<h:form id="panel1Form">
						<div class="formBlock">
							<fieldset>
								<legend>
									<h:outputText value="Estimations" />
								</legend>
								<!-- description -->
								<div>
									<h:outputLabel for="description" value="Description:" />
									<p:inputTextarea id="description"
										value="#{surveyorProcessController.description}"
										style="width:30em" required="true"
										requiredMessage="We need a description">
									</p:inputTextarea>
								</div>
								<!-- <p:message for="description" /> -->
								<!-- Est. costs -->
								<div>
									<h:outputLabel for="estimatedCosts" value="Estimated Costs:" />
									<p:inputText id="estimatedCosts" style="width:15em"
										value="#{surveyorProcessController.estimatedCosts}"
										required="true" requiredMessage="Enter the estimated costs"
										label="Estimated Costs">
										<f:validateLength minimum="2" />
									</p:inputText>
								</div>
							</fieldset>
							<fieldset>
								<legend id="customerData">
									<h:outputText value="Conclusion" />
								</legend>
								<!-- personal negligence or third party fault? -->
								<div>
									<h:outputLabel for="fault"
										value="Personal or third party fault?:" />

									<p:selectOneRadio id="fault"
										value="#{surveyorProcessController.fault}" required="true">
										<f:selectItem itemLabel="Covered Negligence" itemValue="1" />
										<f:selectItem itemLabel="Customer Negligence (Customer Fault)"
											itemValue="2" />
									</p:selectOneRadio>
								</div>
								<div>
									<p:commandButton id="submitData" value="Hand in"
										icon="ui-icon-check"
										action="#{surveyorProcessController.finishSurveyorEstimation}" />

									<p:commandButton id="abort" value="Cancel"
										icon="ui-icon-circle-close"
										action="#{surveyorProcessController.abort}" immediate="true" />
								</div>
							</fieldset>
						</div>
					</h:form>
					<p></p>
					<br></br>
					<p></p>
				</div>
			</f:view>
		</ui:define>
	</ui:composition>
</h:body>
</html>